<?php
/**
 * Target Grid
 */

use Fox\Behaviors;
use Fox\Generator;
use Fox\Msg;
use Fox\Html\Button;
use Fox\Grid;
$id = Xview::instance()->val('grouping');
$grid = new Grid('gTarget');
$grid->fieldcat(array('idusr','fname','lname','email'));
$grid->fieldcat()->field('idusr')->SetHidden();
$grid->SetInput(true,true,true,false);
$grid->fieldcat()->setFieldAttr(array('idusr','fname','lname','email'), 'SetInput',false);
$grid->fieldcat()->setFieldAttr('*', 'SetHiddenInput',true);

$grid->footer()->item(Fox\Grid::BUTTON_DELETE_LINE)->label(Msg(Msg::BUNDLE,Msg::BUT_DELETE));
$grid->footer()->add(new Fox\Html\Button('add','javascript:void(0)'))
			->behaviors(Behaviors::action(
				Generator::url('users','groups','add',array('grouping' => $id)),
				true,
				'#MC_gTarget'
				));
return $grid;